# 用暴力法求两数之和的数

class Solution:
    def __init__(self,nums: list[int] , target: int):
        self.nums = nums
        self.target = target

    def twosum(self):
        result = []
        for i in range(0, len(self.nums)):
            for j in range(i+1, len(self.nums)):
                total = self.nums[i] + self.nums[j]
                if total == self.target:
                    result.append(i)
                    result.append(j)
                    return result

# 找到返回列表中的下标
s1 = Solution([1,3,5,7], 6)
print(s1.twosum())